Fix phpMyAdmin and Adminer crash on PHP 8.5#3444
Merged
Conversation
phpMyAdmin and Adminer created a plain PDO instance and passed it to WP_SQLite_Connection. On PHP 8.5, PDO::sqliteCreateFunction() is deprecated in favor of Pdo\Sqlite::createFunction(). The SQLite integration plugin already handles this by checking instanceof PDO\SQLite, but the check failed because a plain PDO was passed. Let WP_SQLite_Connection create the PDO instance itself by passing the database path instead. Its constructor already selects the correct class (PDO\SQLite on PHP >= 8.4, PDO otherwise). Fixes #3443
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes phpMyAdmin/Adminer crashes on PHP 8.5 by ensuring WP_SQLite_Connection receives a DB path (so it can choose the correct PDO SQLite implementation) instead of a pre-built plain PDO instance.
Changes:
- Replace manual
new PDO('sqlite:...')construction withWP_SQLite_Connection(['path' => ...])in Adminer and phpMyAdmin integrations. - Remove
PDOimports now that direct instantiation is no longer used.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/playground/website/src/components/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php | Pass DB path into WP_SQLite_Connection to avoid deprecated API usage on PHP 8.5 |
| packages/playground/tools/src/phpmyadmin/DbiMysqli.php | Same change for phpMyAdmin DB driver initialization |
| packages/playground/personal-wp/src/components/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php | Mirror the Adminer fix in the personal-wp package |
Comments suppressed due to low confidence (1)
packages/playground/personal-wp/src/components/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php:1
- As in the website variant, the explicit
PDO::ATTR_ERRMODE = PDO::ERRMODE_EXCEPTIONconfiguration was removed. IfWP_SQLite_Connectiondoesn't set this, Adminer behavior may change. Consider enforcing exception mode throughWP_SQLite_Connectiondefaults or constructor options so runtime errors remain visible and consistent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...nents/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php
Show resolved
Hide resolved
ashfame
approved these changes
Mar 31, 2026
Member
ashfame
left a comment
There was a problem hiding this comment.
LGTM! Tested as per instructions.
Note: Adminer was already functional (not throwing any errors) on trunk.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PDOinstance and passed it toWP_SQLite_Connection. The SQLite plugin callsPDO::sqliteCreateFunction(), which is deprecated in PHP 8.5.PDO\SQLiteto use the new API, but the check failed because a plainPDOwas passed.WP_SQLite_Connectioninstead of a pre-builtPDOobject. Its constructor already selects the correctPDOclass.Test plan
npm nx dev playground-websiteand open http://127.0.0.1:5400/website-server/Fixes #3443